# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=otori
pkgver=0.3
pkgrel=5
groups=('blackarch' 'blackarch-exploitation' 'blackarch-webapp')
pkgdesc='Toolbox intended to allow useful exploitation of XML external entity ("XXE") vulnerabilities.'
arch=('any')
url='http://www.beneaththewaves.net/Software/On_The_Outside_Reaching_In.html'
license=('GPL3')
depends=('python2' 'python2-simplejson')
source=("http://www.beneaththewaves.net/Downloads/$pkgname-$pkgver.tar.gz")
sha512sums=('1f482df913d6a3c1aa38f400b330eeca2c8924445339048373af45afe463c0ce7e3f52725bf48f17ecbc020def16c0a356849510120f5115c7c9a5b92388f6e8')

package() {
  cd "$pkgname-$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/otori"

  install -Dm 644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  rm LICENSE.txt

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec python2 $pkgname.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

